package com.dmap.knowledge.service.impl;

import com.dmap.knowledge.dao.SceneMapper;
import com.dmap.knowledge.po.Scene;
import com.dmap.knowledge.po.SceneExample;
import com.dmap.knowledge.service.SceneService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SceneServiceImpl implements SceneService {
    @Resource
    private SceneMapper sceneMapper;
    
    @Override
    public Scene selectByColumnId(long id) {
        return sceneMapper.selectByPrimaryKey(id);
    }
    
    @Override
    public List<Scene> selectSceneDownList(String lang) {
        List<Scene> sceneList;
        SceneExample sceneExample = new SceneExample();
        SceneExample.Criteria criteria = sceneExample.createCriteria();
        if (lang != null) {
            criteria.andLangEqualTo(lang);
        }
        criteria.andStatusEqualTo(1);
        sceneList = sceneMapper.selectByExample(sceneExample);
        return sceneList;
    }
}
